package com.ifcreate.infowell.vo;

import com.ifcreate.infowell.entity.Edge;
import lombok.Getter;

import java.util.*;

/**
 * @Author chenzedeng
 * @Email yustart@foxmail.com
 * @Create 2020-11-02 11:15 上午
 */
@Getter
public class G6DataEntity {

    private List<Map<String, Object>> nodes;

    private Set<Edge> edges;

    public G6DataEntity() {
        this.nodes = new ArrayList<>();
        this.edges = new HashSet<>();
    }

    public G6DataEntity addEdge(Edge edge) {
        this.edges.add(edge);
        return this;
    }

    public void resetNodes(Collection<Map<String, Object>> lists) {
        this.nodes.clear();
        this.nodes.addAll(lists);
    }


    public G6DataEntity addEdgeAll(Collection<Edge> edges) {
        this.edges.addAll(edges);
        return this;
    }


    public G6DataEntity addNode(Map<String, Object> node) {
        this.nodes.add(node);
        return this;
    }

    public G6DataEntity addNodeAll(Collection<Map<String, Object>> nodes) {
        this.nodes.addAll(nodes);
        return this;
    }
}
